import { useRouter } from 'vue-router'
import { message } from 'ant-design-vue';
import children from './routerChildren'
export default [
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/login.vue")
  },
  {
    path: "/404",
    name: "notfind",
    component: () => import("../views/notfind.vue"),
    beforeEnter: (to, from, next) => {
      message.warning('您输入的路径不存在请重新输入')
      next(from.path)
    }
  },
  {
    path: "/",
    component: () => import("@/views/index.vue"),
    redirect: '/index/home',
    children: children
  },
  {
    path: "/:catchAll(.*)",
    redirect: "/404"
  }
];